/*************************************************
 * 描述：汉字转拼音私有实现
 *
 * File：pinyinconverter_p.h
 * Author：zhangzhiming@mozihealthcare.cn
 * Date：25-8-28
 * Update：
 * ************************************************/
#ifndef PINYINCONVERTER_P_H
#define PINYINCONVERTER_P_H
#include <cpp-pinyin/Pinyin.h>
class QString;
class QStringList;

class PinyinConverterPrivate
{

public:
	explicit PinyinConverterPrivate(PinyinConverter* p);
	~PinyinConverterPrivate();
	QString cvt2Pinyin(const QString& str) const;
	QStringList cvt2PinyinList(const QString& str);
	QString cvt2FirstCell(const QString& str) const;
private:
	void init();
	std::vector<std::string> cartesianProduct(const std::vector<std::vector<std::string>> &options);
	void cartesianRecursive(const std::vector<std::vector<std::string>> &options,
						int depth,
						std::string &current,
						std::vector<std::string> &result);
private:
	friend class PinyinConverter;
	PinyinConverter* p;
	std::unique_ptr<Pinyin::Pinyin> m_pyPtr;
};
#endif//PINYINCONVERTER_P_H
